# -*- coding: UTF-8 -*-

# 导入urllib模块
from urllib import request

# 获取一个网页的信息
bilibili = request.urlopen('http://www.bilibili.com')

# 输出网页头部信息
print(bilibili.info())

# 输出网页响应状态码
print(bilibili.getcode())

# 输出请求的url地址
print(bilibili.geturl())

# 输出获取到的全部信息
for line in bilibili:
    print(line)